const { merge } = require('webpack-merge');
const ZipPlugin = require('zip-webpack-plugin');
const baseConfig = require('./webpack.base');
const { name: ProjectName, version: Version } = require('./package.json');

module.exports = merge(baseConfig, {
    mode: 'production',
    plugins: [
        new ZipPlugin({
            filename: `${ProjectName}_${Version}.zip`,
            // 打包的时候不要把sourcemap压缩进去，zip包给出去是不安全的
            exclude: [/sourcemaps/],
        }),
    ],
});
